package com.nfc.demo;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class MyArrayAdapter extends ArrayAdapter<String>
{
	private final Context context;
	private final String[] firstLine;
	private final String[] secondLine;

	public MyArrayAdapter(Context context, String[] firstLine, String[] secondLine)
	{
		super(context, R.layout.rowlayout, firstLine);
		this.context = context;
		this.firstLine = firstLine;
		this.secondLine = secondLine;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent)
	{
		LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View rowView = inflater.inflate(R.layout.rowlayout, parent, false);
		TextView textView1 = (TextView) rowView.findViewById(R.id.firstLine);
		textView1.setText(firstLine[position]);
		TextView textView2 = (TextView) rowView.findViewById(R.id.secondLine);
		textView2.setText(secondLine[position]);

		return rowView;
	}
}
